﻿using System;

class SumSequence
{
    static void Main()
    {
        int[] arr = { 4, 3, 1, 4, 2, 5, 8 };
        int maxSum = 11;
        int start = 0;
        int currentSum = 0;
        for (int i = 0; i < arr.Length; i++)
        {
            start = i;
            currentSum = 0;
            for (int j = i; j < arr.Length; j++)
            {
                currentSum = currentSum + arr[j];
                if (currentSum == maxSum)
                {
                    for (int k = start; k <= arr[j]; k++)
                    {
                        Console.Write(arr[k] + ",");
                    }
                    Console.WriteLine();
                }
              
            }
        }
      
    }
}